
package beans.masters;

import java.sql.*;


import javax.servlet.ServletContext;



/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class FirmMaster {

	public static String FirmName;

				
	public static String getFirmName( ) {
		Connection con = null;
		Statement stmt = null;
		ServletContext context=null;
		ResultSet rs = null;
		StringBuffer query = new StringBuffer();
		String retString = "";
		try {
			    
				con=(Connection)context.getAttribute("dbcon");
          		query.append(" select name, address, city ");
				query.append(" from firm_master ");
			    stmt = con.createStatement();
				rs = stmt.executeQuery(query.toString());
				if (rs.next()) {
					if (rs.getString(1) != null) 
					{
						FirmName = rs.getString(1).trim();
						retString = FirmName;
					}
				}
			

		} catch (Exception e) {
			
		} finally {
			try {
				if (rs != null) {
					rs.close();
				}
				if (stmt != null) {
					stmt.close();
				}
				

			} catch (Exception e) {
			} //end of catch
		}

		return retString;

	} //getFirmName()


}



